home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
130 MIDI Tool Box
/
130 MIDI Tool Box.iso
/
midifile
/
mfstring.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-03-05
|
544b
|
38 lines
/* This program, when compiled with the midifile(3) library, will */
/* print only the text messages in a standard MIDI file. */
#include <stdio.h>
#include <ctype.h>
#include "midifile.h"
FILE *F;
mygetc() { return(getc(F)); }
mytext(type,leng,msg)
char *msg;
{
char *p;
char *ep = msg + leng;
for ( p=msg; p<ep ; p++ )
putchar( isprint(*p) ? *p : '?' );
putchar('\n');
}
main(argc,argv)
char **argv;
{
if ( argc > 1 )
F = fopen(argv[1],"r");
else
F = stdin;
Mf_getc = mygetc;
Mf_text = mytext;
midifile();
exit(0);
}